Optimal. Leaf size=144 \[ \frac {d \left (2 a c d+b \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}-x \left (b d \left (3 c^2-d^2\right )-a \left (c^3-3 c d^2\right )\right )-\frac {\left (3 a c^2 d-a d^3+b c^3-3 b c d^2\right ) \log (\cos (e+f x))}{f}+\frac {(a d+b c) (c+d \tan (e+f x))^2}{2 f}+\frac {b (c+d \tan (e+f x))^3}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.17, antiderivative size = 144, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3528, 3525, 3475} \[ \frac {d \left (2 a c d+b \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}-\frac {\left (3 a c^2 d-a d^3+b c^3-3 b c d^2\right ) \log (\cos (e+f x))}{f}-x \left (b d \left (3 c^2-d^2\right )-a \left (c^3-3 c d^2\right )\right )+\frac {(a d+b c) (c+d \tan (e+f x))^2}{2 f}+\frac {b (c+d \tan (e+f x))^3}{3 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3525
Rule 3528
Rubi steps
\begin {align*} \int (a+b \tan (e+f x)) (c+d \tan (e+f x))^3 \, dx &=\frac {b (c+d \tan (e+f x))^3}{3 f}+\int (c+d \tan (e+f x))^2 (a c-b d+(b c+a d) \tan (e+f x)) \, dx\\ &=\frac {(b c+a d) (c+d \tan (e+f x))^2}{2 f}+\frac {b (c+d \tan (e+f x))^3}{3 f}+\int (c+d \tan (e+f x)) \left (-2 b c d+a \left (c^2-d^2\right )+\left (2 a c d+b \left (c^2-d^2\right )\right ) \tan (e+f x)\right ) \, dx\\ &=-\left (b d \left (3 c^2-d^2\right )-a \left (c^3-3 c d^2\right )\right ) x+\frac {d \left (2 a c d+b \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {(b c+a d) (c+d \tan (e+f x))^2}{2 f}+\frac {b (c+d \tan (e+f x))^3}{3 f}+\left (b c^3+3 a c^2 d-3 b c d^2-a d^3\right ) \int \tan (e+f x) \, dx\\ &=-\left (b d \left (3 c^2-d^2\right )-a \left (c^3-3 c d^2\right )\right ) x-\frac {\left (b c^3+3 a c^2 d-3 b c d^2-a d^3\right ) \log (\cos (e+f x))}{f}+\frac {d \left (2 a c d+b \left (c^2-d^2\right )\right ) \tan (e+f x)}{f}+\frac {(b c+a d) (c+d \tan (e+f x))^2}{2 f}+\frac {b (c+d \tan (e+f x))^3}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 1.01, size = 130, normalized size = 0.90 \[ \frac {6 d \left (3 a c d+3 b c^2-b d^2\right ) \tan (e+f x)+3 d^2 (a d+3 b c) \tan ^2(e+f x)+3 (b+i a) (c-i d)^3 \log (\tan (e+f x)+i)+3 (b-i a) (c+i d)^3 \log (-\tan (e+f x)+i)+2 b d^3 \tan ^3(e+f x)}{6 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.55, size = 142, normalized size = 0.99 \[ \frac {2 \, b d^{3} \tan \left (f x + e\right )^{3} + 6 \, {\left (a c^{3} - 3 \, b c^{2} d - 3 \, a c d^{2} + b d^{3}\right )} f x + 3 \, {\left (3 \, b c d^{2} + a d^{3}\right )} \tan \left (f x + e\right )^{2} - 3 \, {\left (b c^{3} + 3 \, a c^{2} d - 3 \, b c d^{2} - a d^{3}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) + 6 \, {\left (3 \, b c^{2} d + 3 \, a c d^{2} - b d^{3}\right )} \tan \left (f x + e\right )}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 4.81, size = 2046, normalized size = 14.21 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.03, size = 247, normalized size = 1.72 \[ \frac {b \,d^{3} \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}+\frac {\left (\tan ^{2}\left (f x +e \right )\right ) a \,d^{3}}{2 f}+\frac {3 \left (\tan ^{2}\left (f x +e \right )\right ) b c \,d^{2}}{2 f}+\frac {3 a c \,d^{2} \tan \left (f x +e \right )}{f}+\frac {3 b \,c^{2} d \tan \left (f x +e \right )}{f}-\frac {b \,d^{3} \tan \left (f x +e \right )}{f}+\frac {3 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a \,c^{2} d}{2 f}-\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) a \,d^{3}}{2 f}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c^{3} b}{2 f}-\frac {3 \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) b c \,d^{2}}{2 f}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) a \,c^{3}}{f}-\frac {3 \arctan \left (\tan \left (f x +e \right )\right ) a c \,d^{2}}{f}-\frac {3 \arctan \left (\tan \left (f x +e \right )\right ) b \,c^{2} d}{f}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) b \,d^{3}}{f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.91, size = 143, normalized size = 0.99 \[ \frac {2 \, b d^{3} \tan \left (f x + e\right )^{3} + 3 \, {\left (3 \, b c d^{2} + a d^{3}\right )} \tan \left (f x + e\right )^{2} + 6 \, {\left (a c^{3} - 3 \, b c^{2} d - 3 \, a c d^{2} + b d^{3}\right )} {\left (f x + e\right )} + 3 \, {\left (b c^{3} + 3 \, a c^{2} d - 3 \, b c d^{2} - a d^{3}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 6 \, {\left (3 \, b c^{2} d + 3 \, a c d^{2} - b d^{3}\right )} \tan \left (f x + e\right )}{6 \, f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 5.23, size = 142, normalized size = 0.99 \[ x\,\left (a\,c^3-3\,b\,c^2\,d-3\,a\,c\,d^2+b\,d^3\right )-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (b\,d^3-3\,c\,d\,\left (a\,d+b\,c\right )\right )}{f}+\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a\,d^3}{2}+\frac {3\,b\,c\,d^2}{2}\right )}{f}-\frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (-\frac {b\,c^3}{2}-\frac {3\,a\,c^2\,d}{2}+\frac {3\,b\,c\,d^2}{2}+\frac {a\,d^3}{2}\right )}{f}+\frac {b\,d^3\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.46, size = 240, normalized size = 1.67 \[ \begin {cases} a c^{3} x + \frac {3 a c^{2} d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 a c d^{2} x + \frac {3 a c d^{2} \tan {\left (e + f x \right )}}{f} - \frac {a d^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a d^{3} \tan ^{2}{\left (e + f x \right )}}{2 f} + \frac {b c^{3} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} - 3 b c^{2} d x + \frac {3 b c^{2} d \tan {\left (e + f x \right )}}{f} - \frac {3 b c d^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {3 b c d^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} + b d^{3} x + \frac {b d^{3} \tan ^{3}{\left (e + f x \right )}}{3 f} - \frac {b d^{3} \tan {\left (e + f x \right )}}{f} & \text {for}\: f \neq 0 \\x \left (a + b \tan {\relax (e )}\right ) \left (c + d \tan {\relax (e )}\right )^{3} & \text {otherwise} \end {cases} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________